<%@ page import="com.wn.com.wn.bean.User" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: scott
  Date: 0030
  Time: 10:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%

    // 内置对象: jsp内置可以直接使用的对象 (jsp_xxx.java中把这些内置对象初始化了 )
    request.setAttribute("name","黄蓉");
    request.setAttribute("age1","23");
    //内置对象存储数据的输出

    String name = (String) request.getAttribute("name");
    String age = (String) request.getAttribute("age");

    User user = new User();
    user.setUsername("郭靖");
    user.setPassword("123");
    pageContext.setAttribute("user",user);

    List<String> list = new ArrayList();

    list.add("郭靖");
    list.add("old player");
    list.add("黄药师");
    pageContext.setAttribute("list",list);
%>


<%= name %>
<%= age %>

<%--解决问题  el 表达式  结果的输出 --%>
${name}
${age}

${user}
${user.username}
${user.password}

${list}
${list[1]}

</body>
</html>
